

import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/subwayst/swStPlanWeek/page/1',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/subwayst/swStPlanWeek/',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/subwayst/swStPlanWeek/' + id,
    method: 'get'
  })
}

export function delObj(row) {
  return request({
    url: '/subwayst/swStPlanWeek/' + row.id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/subwayst/swStPlanWeek/',
    method: 'put',
    data: obj
  })
}

export function submit(ids) {
  return request({
    url: '/subwayst/swStPlanWeek/submit',
    method: 'put',
    data: ids
  })
}

export function approve(obj) {
  return request({
    url: '/subwayst/swStPlanWeek/audit',
    method: 'put',
    data: obj
  })
}

export function exportExcel(query) {
  return request({
    url: '/subwayst/swStPlanWeek/export',
    method: 'get',
    responseType:'blob',
    params: Object.assign({planType: 1}, query)
  })
}
